package com.laoxu.test.sqlitedemo.mapper;

import com.laoxu.test.sqlitedemo.model.AccountDO;
import com.laoxu.test.sqlitedemo.model.query.AccountQuery;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author kalong
* @date 2021/6/10
*/
    
@Mapper
public interface AccountMapper {
    /**
     * delete by primary key
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * insert record to table
     * @param record the record
     * @return insert count
     */
    int insert(AccountDO record);

    /**
     * insert record to table selective
     * @param record the record
     * @return insert count
     */
    int insertSelective(AccountDO record);

    /**
     * select by primary key
     * @param id primary key
     * @return object by primary key
     */
    AccountDO selectByPrimaryKey(Integer id);

    List<AccountDO> selectByQuery(AccountQuery accountQuery);

    /**
     * update record selective
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(AccountDO record);

    /**
     * update record
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(AccountDO record);

    int batchInsert(@Param("list") List<AccountDO> list);
}